package com.mybatis;

import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface EmployeeMapper {


	/*返回List*/
	List<Employee> getEmpsByLastNameLike(String lastName);
	Employee selectEmployeebyId(int i);
	Employee selectEmployeebyMap(Map map);
	Employee selectEmployeebyIdAndLastName(@Param("id") int id,@Param("lastName") String lastName);
	void addEmp(Employee employee);
	void updateEmp(Employee employee);
	void delEmpById(Integer id);

	/*返回一条记录的map，key是列名，值是对应的值*/
	Map<String,Object> selectMap(Integer id);

	/*返回Map<id,record>*/
	@MapKey("id") //封装这个map的时候，使用id作为map的key
	Map<Integer,Employee> getEmpByLastName(String lastName);

}
